#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define Random(x) (rand() % x)
int sra()
{
	int result;
	int dis=4; 
	result=(Random(dis))+1;
	return result;
}
void SUI()
{
	printf("1,Start\n2,How\n\n\n\n\n@MADE BY STARCH");
}
void HOW()
{
	system("cls");
	printf("Press 'f' 'g' 'h' 'j' to get scores");
	system("pause");
}
void main()
{
	int goal,score;
	int i,j,k;
	char temp='h';
	char input;
	short int game=1;
	SUI();
	input=getch();
	switch(input)           //开---------始------------UI 
	{
		case 1:goto GAME; j=0; break;
		case 2:HOW(); break;
	}
	GAME:while(game=1)
	{
		system("cls");
		goal=sra();       //随----------------机------------------数 
		printf("SCORE:%d\n",score);
		for(i=0;i<4;i++)//图------------像------------生---------------成 
		{
			if((i+1)==goal)
			{
				printf("@@");
			}
			else
			{
				printf("##");
			}
			printf(" "); 
			if(i==3) printf("\n");
		}
		printf("F |G |H |J |\n");
		switch(goal)//键-----------入----------------数-----------据------------转-----------换 
		{
			case 1:temp='f'; break;
			case 2:temp='g'; break;
			case 3:temp='h'; break;
			case 4:temp='j'; break;
		}
		input=getch();
		if(input==temp)
		{
			score++;
		}
		else game=0;
		if(game==0) break;//游--------------戏----------------循-------------环---------------结-------------束 
	}
	system("cls");
	printf("You hava DIE!\nInput 'SPACE' to replay");
	input=getch();
	if(input==' ') goto GAME; game=1;
} 